<?php
namespace app\examScore\controller;
use app\common\Base;
use think\Db;
use app\common\AsyncCommand;
//--统计各项汇总数据
class ExamTotalAnalysis extends Base {
	
	public function index() {
		return $this->fetch();
	}

	public function pageQuery() {
		$result = Db::table("考试名称")->alias("a")
			  ->join("年级名称 b","a.年级ID=b.ID","LEFT")
			  ->where("DATEDIFF(day, 登分终止日期, getdate()) < 30")
			  ->field("a.ID,年级名称,考试名称,登分终止日期")
			  ->order("ID")
			  ->select();
		$grid["rows"] = selectResult($result);
		$grid["total"] = count($result);
		return $grid;
	}

	public function execTotal() {
		$examId = input("examId");
		try {
			Db::query('exec chengjifenxi ?',[$examId]);
			return $codeu[0][0]["result"];
		} catch (\Exception $e) {
	    	return $e->getMessage();
	    }
	}
	
}
